#ifndef EQUIPWIDGET_H
#define EQUIPWIDGET_H

#include"ui_equip.h"
#include<QValidator>

#include "serialize/equipment.h"

namespace Ui{
class EquipWidget;
}

class EquipWidget : public QWidget
{
    Q_OBJECT

public:
    explicit EquipWidget(QWidget* p=0);
    ~EquipWidget();

    inline void setFilePath(QString s){filePath = s;}
    inline void setWorkPath(QString s){workPath = s;}
    Equipment getEquipmentFromUI();
    void displayEquipmentToUI(Equipment& m);
    Equipment readEquipmentFromFile();
    bool saveEquipmentToFile();

    static void exportToBinary(QString workspacepath);
    static void exportToXML(QString workspacepath);
    static bool importFromXML(QString workspacepath,QString xmlFile);

    void clearUI();

    Ui::EquipWidget* ui;

private:
    QString filePath;
    QString workPath;
    void setInputMask();
};

#endif // EQUIPWIDGET_H
